<!doctype html>
<html>
<head>
	<title>今日头条</title>
	<meta charset="utf-8">
	<script type="text/javascript" src="build/react.js"></script>
	<script type="text/javascript" src="build/react-dom.js"></script>
	<script type="text/javascript" src="build/browser.min.js"></script>
	<script type="text/javascript" src="build/jquery.min.js"></script>
</head>
<body>
	<div id="root"></div>
	<script type="text/babel">
		var styles = {
			showInf:{
				color:'#fff9ae',
				background:'#99ffc3',
				lineHeight:'60px',
				fontSize:'24px',
				borderRadius:'3px',
				textAlign:'center',
				margin:'8px auto',
				width:'60%',
				overflow:'hidden'
			}
		}
		var names = ['asdfasdf',"asdfasdf","a南北朝的"];
		var Message = React.createClass({
			getInitialState:function(){
				return {
					value:"",
					data:[]
				}
			},
			getDefaultProps:function  (argument) {
				return {
					name: "\'yourName\'"
				}
			},
			propTypes:{
				name:React.PropTypes.string.isRequired,
			},
			componentDidMount:function(){
				var that = this;
				$.ajax({
					url:'http://v.juhe.cn/toutiao/index',
					data:{
						type:'top',
						key:'edba5f02bad5f01fc949ee2d0d8598d6'
					},
					beforeSend: function (XMLHttpRequest) {
                     XMLHttpRequest.setRequestHeader(sessionid, sid);
                 	},
					success:function(result){
						evel(result);
						console.log(result.result)
						var _result = JSON.parse(result)
						if(that.isMounted()){
							that.setState({
								data:_result.data
							})
						}
					}

				})
			},
			render:function(){
				return (
					<div style={{border:'1px solid #ccc'}}>
						
						<h1 style={styles.showInf}> {this.props.name}</h1>

					</div>
					)
			}
		});

		
		ReactDOM.render(
			<Message />,
			document.getElementById("root")
		);
	</script>

</body>
</html>